package com.facebook.app.shared.facebookData;

import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.NotPersistent;
import javax.jdo.annotations.PersistenceCapable;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class FacebookLike extends FacebookData {

	private static final long serialVersionUID = -2801361867607619568L;

	@NotPersistent
	private transient String category;

	@NotPersistent
	private transient String created_time;

	public FacebookLike(String name, long id, String category,
			String created_time) {
		super(name, id);

		this.category = category;
		this.created_time = created_time;
	}

	// The default constructor is needed for converting JSON Strings to
	// FacebookLike objects.
	@SuppressWarnings("unused")
	private FacebookLike() {}

	public String getCategory() {
		return category;
	}

	public String getCreated_time() {
		return created_time;
	}

	@Override
	public String toString() {
		return "FacebookLike [name=" + getName() + ", category="
				+ getCategory() + ", id=" + getId() + ", created_time="
				+ getCreated_time() + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + (int) (getId() ^ (getId() >>> 32));
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		FacebookLike other = (FacebookLike) obj;
		if (getId() != other.getId())
			return false;
		return true;
	}

}
